package com.tfj.mvp.tfj.home.shop;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hyphenate.tfj.R;
import com.jakewharton.rxbinding2.view.RxView;
import com.tfj.comm.bean.Constant;
import com.tfj.mvp.base.BaseActivity;
import com.tfj.mvp.tfj.home.shop.bean.ShopShowBean;
import com.tfj.mvp.tfj.live.bean.TagBean;
import com.tfj.utils.AntiShakeUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Liang_Lu on 2017/12/21.
 *
 * @author HuangQiang
 * @github https://github.com/HuangQiang
 */

public class VShopShowListActivity extends BaseActivity<PShopShowImpl> implements CShopShow.IVShopShow {


    @BindView(R.id.editText_search)
    EditText editTextSearch;
    @BindView(R.id.recyclew_content)
    RecyclerView recyclewContent;

    @Override
    protected void initView() {
        super.initView();
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        recyclewContent.setLayoutManager(linearLayoutManager);
        recyclewContent.setAdapter(quickAdapter_shop);
        List<ShopShowBean> shopShowBeans = new ArrayList<>();
        shopShowBeans.add(new ShopShowBean());
        shopShowBeans.add(new ShopShowBean());
        shopShowBeans.add(new ShopShowBean());
        shopShowBeans.add(new ShopShowBean());
        shopShowBeans.add(new ShopShowBean());
        quickAdapter_shop.replaceData(shopShowBeans);
    }

    @Override
    public int setContentViewId() {
        return R.layout.activity_shopshow;
    }

    @Override
    public void createPresenter() {
        mPresenter = new PShopShowImpl(mContext, this);
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    private QuickAdapter_Shop quickAdapter_shop = new QuickAdapter_Shop();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    public class QuickAdapter_Shop extends BaseQuickAdapter<ShopShowBean, BaseViewHolder> {
        public QuickAdapter_Shop() {
            super(R.layout.item_shopshow);
        }

        @Override
        protected void convert(BaseViewHolder viewHolder, final ShopShowBean item) {
            RelativeLayout rl_out = viewHolder.getView(R.id.rl_out);
            rl_out.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if(AntiShakeUtils.isInvalidClick(v)){
                     return;
                    }
                    startActivity(VShopDetailAcitivity.class);
                }
            });
        }
    }
}
